<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="com.jianzh5.common.EnvParams" %>
<style>
.customTable{width: 100% ; border: 1px solid rgb(219,219,219);}
    .customTable td{height: 35px; padding-left: 10px;}

</style>
<%
    long timePageStart = System.currentTimeMillis();
    EnvParams env = new EnvParams();
    env.setHashTable();
    String action = new String("");
    String act = new String("action");
    if(request.getQueryString() != null && request.getQueryString().indexOf("act",0) >= 0)
        action = request.getParameter(act);

%>
<div class="breadcrumbs">
	<script type="text/javascript">
		try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
	</script>
	<ul class="breadcrumb">
		<li>
			<i class="ace-icon fa fa-home home-icon"></i>
			<a href="#">首页</a>
		</li>
		<li class="active">控制台</li>
	</ul><!-- /.breadcrumb -->
	
	<div class="nav-search" id="nav-search">
		<form class="form-search">
			<span class="input-icon">
				<input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input" autocomplete="off" />
				<i class="ace-icon fa fa-search nav-search-icon"></i>
			</span>
		</form>
	</div><!-- /.nav-search -->
</div>

<div class="page-content">
	<div class="row">
		<div class="col-xs-12">
            <div class="widget-box">
                <div class="widget-header widget-header-small">
                    <h5 class="widget-title smaller">服务器相关信息配置</h5>

                    <div class="widget-toolbar no-border">
                        <ul class="nav nav-tabs" id="myTab">
                            <li class="active">
                                <a data-toggle="tab" href="#home">服务器参数</a>
                            </li>

                            <li>
                                <a data-toggle="tab" href="#profile">JAVA参数</a>
                            </li>

                            <li>
                                <a data-toggle="tab" href="#info">服务器连接速度</a>
                            </li>
                        </ul>
                    </div>

                    <!-- /section:custom/widget-box.tabbed -->
                </div>

                <div class="widget-body">
                    <div class="widget-main padding-6">
                        <div class="tab-content">
                            <div id="home" class="tab-pane in active">
                                <table class="customTable" border="1">
                                    <tr>
                                        <td>服务器名</td>
                                        <td colspan="3"><%= request.getServerName() %>(<%=request.getRemoteAddr()%>)</td>
                                    </tr>
                                    <tr>
                                        <td>服务器操作系统</td>
                                        <td colspan="3"><%=env.queryHashtable("os.name")%> <%=env.queryHashtable("os.version")%><%=env.queryHashtable("sun.os.patch.level")%></td>
                                    </tr>
                                    <tr>
                                        <td>服务器类型</td>
                                        <td><%=env.queryHashtable("os.arch")%></td>
                                        <td>服务器操作系统模式</td>
                                        <td><%=env.queryHashtable("sun.arch.data.model")%>位</td>
                                    </tr>
                                    <tr>
                                        <td>服务器时区</td>
                                        <td><%=env.queryHashtable("user.timezone")%></td>
                                        <td>服务器时间</td>
                                        <td><%=new java.util.Date()%></td>
                                    </tr>
                                    <tr>
                                        <td>服务器编译引擎</td>
                                        <td><%= request.getServletContext().getServerInfo() %></td>
                                        <td>服务器端口</td>
                                        <td><%= request.getServerPort() %></td>
                                    </tr>
                                    <tr>
                                        <td>服务器所在地</td>
                                        <td><%=env.queryHashtable("user.country")%></td>
                                        <td>用户目录</td>
                                        <td><%=env.queryHashtable("user.dir")%></td>
                                    </tr>
                                </table>
                            </div>

                            <div id="profile" class="tab-pane">
                                <table class="customTable" border="1">
                                    <tr>
                                        <td>名称</td>
                                        <td>英文名称</td>
                                        <td>版本</td>
                                    </tr>
                                    <tr>
                                        <td>JAVA运行环境名称</td>
                                        <td><%=env.queryHashtable("java.runtime.name")%></td>
                                        <td><%=env.queryHashtable("java.runtime.version")%></td>
                                    </tr>
                                    <tr>
                                        <td>JAVA虚拟机名称</td>
                                        <td><%=env.queryHashtable("java.vm.name")%></td>
                                        <td><%=env.queryHashtable("java.vm.version")%></td>
                                    </tr>
                                    <%
                                        float fFreeMemory=(float)Runtime.getRuntime().freeMemory();
                                        float fTotalMemory=(float)Runtime.getRuntime().totalMemory();
                                        float fPercent=fFreeMemory/fTotalMemory*100;
                                    %>
                                    <tr>
                                        <td>JAVA虚拟机剩余内存：</td>
                                        <td colspan="3"><%=fFreeMemory/1024/1024%>M </td>
                                    </tr>
                                    <tr>
                                        <td>JAVA虚拟机分配内存</td>
                                        <td colspan="3"><%=fTotalMemory/1024/1024%>M</td>
                                    </tr>
                                </table>
                            </div>

                            <div id="info" class="tab-pane">
                                <table class="customTable" border="1">
                                    <tr>
                                        <td>接入设备</td>
                                        <td>连接速度</td>
                                        <td>下载速度</td>
                                    </tr>
                                    <tr>
                                        <td>本机</td>
                                        <td><%=env.test_int()%> 毫秒</td>
                                        <td><%=env.test_sqrt()%> 毫秒</td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
		</div>

        <div class="col-xs-6">
            <div class="widget-box">
                <div class="widget-header widget-header-flat">
                    <h4 class="widget-title smaller">更新时间轴</h4>
                    <div class="widget-toolbar">
                        <a href="#" data-action="fullscreen" class="orange2">
                            <i class="ace-icon fa fa-expand"></i>
                        </a>

                        <a href="#" data-action="reload">
                            <i class="ace-icon fa fa-refresh"></i>
                        </a>

                        <a href="#" data-action="collapse">
                            <i class="ace-icon fa fa-chevron-up"></i>
                        </a>

                        <a href="#" data-action="close">
                            <i class="ace-icon fa fa-times"></i>
                        </a>
                        <label>
                            <input id="id-check-horizontal2" type="checkbox" class="ace ace-switch ace-switch-6" />
                            <span class="lbl middle"></span>
                        </label>
                    </div>
                </div>
                <div class="widget-body">
                    <div class="widget-main">
                    </div>
                </div>
            </div>
        </div>

	</div>
</div>